import httpInstance from '../utils/http';

/**
 * @description 获取未读消息
 * @param userId 用户Id
 * @returns
 */
export function getUnreadMessageApi(userId) {
  return httpInstance.get('/userUnreadMessage/getUnreadMessage', {
    params: {
      userId
    }
  });
}


/**
 * @description 减少未读消息
 * @param userId 用户Id
 * @param messageId 消息类型Id 不穿默认设为0
 * @param number 减少的数量
 * @returns
 */
export function reduceUnreadMessageApi({
  userId,
  type,
  number = 0
} = {}) {
  return httpInstance.post('/userUnreadMessage/reduceUnreadMessage', {
    userId,
    type,
    number
  });
}